function check_title(title){
    var pattern = /^[\w0-9 \;\:\.\,èéòàìù]{3,20}/;
    if(!title.match(pattern)){
        return false;
    }
    return true;
}

function check_timeFlow(date1,date2){
    date1 = new Date(date1);
    date2 = new Date(date2);
    if(date1>date2)
        return false;
    else return true;
}

function check_date_mdY(date){
    var ret = true;
    date = date.split('/');
    if(date.length!=3)
        ret = false;
    var day = parseInt(date[0]);
    var month = parseInt(date[1]);
    var year = parseInt(date[2]);
    if((month>12 || day>31))
        ret = false;
    if((month==4 || month==6 || month==9 || month==11) && day>30)
        ret = false;
    if(((year%4==0 && year%400 == 0) || (year%4==0 && year%100!=0)) && month == 2 && day>29)
        ret = false;
    if(!((year%4==0 && year%400 == 0) || (year%4==0 && year%100!=0)) && month==2 && day>28)
        ret = false;
    return ret;
}

function check_description(description){
    var pattern = /^[\w0-9 \;\:\.\,èéòàìù]{3,250}/;
    if(!description.match(pattern)){
        return false;
    }
    return true;
}

function check_metatags(metatags){
    var pattern = /^[\w0-9 \,èéòàìù]{3,200}/;
    if(!metatags.match(pattern)){
        return false;
    }
    return true;
}